package cn.disignPattern.com.partFour.store;

import cn.disignPattern.com.partFour.pizza.Pizza;
import cn.disignPattern.com.partFour.SimplePizzaFactory;

/**
 * TODO
 *
 * @author ：ljf
 * @date ：Created in 2021/8/16 15:29
 */
public abstract class PizzaStore {

    SimplePizzaFactory factory;

    public PizzaStore(SimplePizzaFactory factory){
        this.factory = factory;
    }

    public Pizza orderPizza(String type){
        Pizza pizza = createPizza(type);
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
        return pizza;
    }

    abstract Pizza createPizza(String type);

}
